package com.eternal.widget.guqiang;

import androidx.databinding.BindingAdapter;

import com.eternal.framework.binding.command.BindingCommand;

/**
 * Created by Administrator
 * On 2020/4/29
 * Description:
 * @author Administrator
 */
public class ToolbarAdapter {
    @BindingAdapter(value = {"title"})
    public static void setTitle(Toolbar toolbar, String title){
        toolbar.setTitle(title);
    }

    @BindingAdapter(value = {"onBack"}, requireAll = false)
    public static void onBack(Toolbar toolbar, BindingCommand<Void> command){
        com.eternal.framework.binding.viewadapter.view.ViewAdapter.
                onClickCommand(toolbar.getBack(), command, false);
    }

    @BindingAdapter(value = {"onNext"}, requireAll = false)
    public static void onNext(Toolbar toolbar, BindingCommand<Void> command){
        com.eternal.framework.binding.viewadapter.view.ViewAdapter.
                onClickCommand(toolbar.getNext(), command, false);
    }


}
